class Squash extends GuaAnimation {
    static new(game) {
        let p = new this(game, animationSquash)
        p.setup()
        return p
    }

    setup() {
        // row表示在草地的第几排
        this.row = -1
        this.score = 50
        this.up = 31
        this.ready = false
    }

    remove() {
        this.scene.removeChomper(this)
    }

    cracked() {
        this.changeAnimation('attack')
        this.y -= 200

        this.ready = true
    }

    update() {
        super.update()
        if (this.ready) {
            this.up--
            if (this.up === 0) {
                this.remove()
            }
        }
    }
}